<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>洪雅智慧旅游项目接口测试报告</title>
</head>
<body>
<form method="get" action="/all_html_name">
    <div class="test">
        <span>测试报告名称:</span>
        <select name="" id="html_name" onchange="savehtmlname(this.value);"></select>
        <script>
            function savehtmlname(value) {
                save_html_name = value

            }

            let data;
            let ajax = new XMLHttpRequest();
            ajax.open('get', '/all_html_name');
            ajax.send();
            ajax.onreadystatechange = function () {
                if (ajax.readyState === 4 && ajax.status === 200) {
                    data = ajax.responseText;
                    let sel = document.getElementById('html_name');
                    let str = "";
                    data = data.split(',');
                    for (let i = 0; i < data.length; i++) {
                        str += `<option value=${data[i]}>` + data[i] + `</option>`;
                    }
                    sel.innerHTML = str;
                }

            }
        </script>
    </div>
</form>
</body>
</html>